{{- $anchor := printf "<a class=\"anchor ms-1\" href=\"#%s\"></a>" .Anchor | safeHTML -}}
{{- $numberifyHeadings := true }}
{{- if isset .Page.Params "numberifyheadings" }}
  {{- $numberifyHeadings = .Page.Params.numberifyHeadings }}
{{- end }}
{{ printf "<h%d id=\"%s\"%s>%s%s</h%d>"
  .Level
  .Anchor
  (cond $numberifyHeadings ` data-numberify` ``)
  .PlainText
  $anchor
  .Level | safeHTML
}}
